<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>隐私政策</title>
</head>
<body>
  <h1 style="text-align: center" id="title"></h1>
  <div id="editor"></div>
</body>
</html>

<script>
  window.onload = function () {
    getData()
  }

  function getData() {
    fetch('https://app.hnshengzhong.cn/api/index/policy?type=privacy', {
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    }).then(res => res.text()).then(res => {
      console.log(res)
      const result = JSON.parse(res)
      document.getElementById('editor').insertAdjacentHTML('afterend', result.data.content)
      document.getElementById('title').innerText = result.data.title
    }).catch(err => {
      console.error(err)
    })
  }
</script>